Generating Web Service Operations on Java Classes |
|
Before you begin this task:
Ensure that the Java Class Metadata model is available.
This option facilitates generating Web service operations on a Java Class Metadata that is mapped to a JAR file or Java classes that were created outside Process Platform environment. This feature helps you to import any application logic in the form of Java files that you think is important or relevant to the application being built. The Web service operations that you create on these files can be published in the same way you create and publish Web service operations on a database.
- Select one of the starting points:
- In Workspace Documents (My Recent Documents) window, place the mouse pointer over (Java Class Metadata), click and select Actions > Generate Web services.
- Open Workspace Documents (Explorer) > <solution> > <project>, right-click <Java Class Metadata> and select Generate Web services. The Java Class Metadata window appears, displaying the name of the Java Class Metadata on its title bar.
- In the Java Class Metadata Explorer, expand the Java Class model and select the (Java Class) on which you want to generate the Web services.
Note:
You can only select Static methods. The methods of the selected Java Class appear on the right-side pane. - On the Methodstab, select the methods upon which you want to generate the Web service operations. You can also perform the following optional activities:
- Change the name of the Web service operation to suit your functional needs.
- For a selected Web service operation, click and do the following on the Advanceddialog box:
- If you want to treat a parameter with i4 data type as XML in a request, select the XML Node check box. The check box appears only if the data type is i4. XML Node is not applicable for other data types.
- Modify the parameter name depending upon your functional needs. The implementation will display this name instead of the default parameter name. Even if you change the name, the values will remain intact.
- Depending upon whether you want the parameter in the request or in response or in both, set the Scope to in (only in request), out (only in response), or inout (in both request and response).Click OK to save the changes and close the dialog box.
- On the Web service Interface Detailstab, do one of the following:
- Generate Web service operations under a new Web service interface. You may change the names in the Web service, Web service Interface Name and the Namespace fields if you do not want the default ones. Click to browse and choose a Location to create the Web service interface.
- Select Existing to generate the Web service operations within an existing Web service interface. Click to browse and choose the Web service interface.
- Click Finish. The Java Class Metadata window closes.
The Web service operations for the selected Java Class are generated. The Web service bearing the Web service Interface and Web service Operations for the selected Java Class(es) is stored at the same location where the Java Class Metadata is stored.
After you complete this task
After you generate the Web service, do the following:
- In the Web service Interface properties, select the Service to which this Web service will be attached.
- Publish the generated Web service operations to the organization and attach the Web service interface to the WS-AppServer Service before you can use them at runtime.
- The JAR location should be added to the classpath.
- Restart the WS-AppServer service.